import request from '@/utils/request'
import apis from './'

export function getInvoiceList (parameter) {
  return request({
    url: apis.InvoiceList,
    method: 'get',
    params: parameter
  })
}

export function getInvoiceNum (parameters) {
  return request({
    url: apis.InvoiceNum,
    method: 'get',
    params: parameters
  })
}

export function getInvoiceDetail (id) {
  return request({
    url: `${apis.InvoiceDetail}?invoice_id=${id}`,
    method: 'get'
  })
}

export function getCheckInvoice (id) {
  return request({
    url: `${apis.CheckInvoice}?invoice_id=${id}`,
    method: 'get'
  })
}

export function postCheckInvoice (data) {
  return request({
    url: `${apis.CheckInvoice}?invoice_id=${data.invoice_id}`,
    method: 'post',
    data: data
  })
}

export function SetInvoiceRead (id) {
  return request({
    url: `${apis.InvoiceRead}?invoice_id=${id}`,
    method: 'get'
  })
}
